package com.cn.service.server.admin.Impl;


import com.cn.mapper.dao.db1.admin.AdminRoleDao;
import com.cn.service.server.admin.AdminRoleServer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.cn.bean.pojo.bc.Role;
import java.util.List;

@Service
public class AdminRoleServerImpl implements AdminRoleServer {
    private AdminRoleDao adminRoleDao;

    @Autowired(required=false)
    public AdminRoleServerImpl(AdminRoleDao adminRoleDao) {
        this.adminRoleDao = adminRoleDao;
    }

    @Override
    public List<Role> selectRole() {
        return adminRoleDao.selectRole();
    }

    @Override
    public List<Role> selectRoleUserName(String userName) {
        return adminRoleDao.selectRoleUserName(userName);
    }

    @Override
    public List<Role> selectAdminRole(String roleId, String roleName, int limit, int page) {
        return adminRoleDao.selectAdminRole(roleId, roleName, limit, page);
    }

    @Override
    public List<Role> selectRoleId(int roleId) {
        return adminRoleDao.selectRoleId(roleId);
    }

    @Override
    public int insertAdminRole(int roleId, String roleName, int status, String remark, String register_time) {
        return adminRoleDao.insertAdminRole(roleId, roleName, status, remark, register_time);
    }

    @Override
    public int updateAdminRole(int roleId, String roleName, int status, String remark, String update_time) {
        return adminRoleDao.updateAdminRole(roleId, roleName, status, remark, update_time);
    }

    @Override
    public int getAutoId() {
        return adminRoleDao.getAutoId();
    }

    @Override
    public int repeatRoleName(String roleName) {
        return adminRoleDao.repeatRoleName(roleName);
    }

    @Override
    public int deleteAdminRole(int roleId) {
        return adminRoleDao.deleteAdminRole(roleId);
    }

    @Override
    public int deleteAdminRoleMenu(int roleId) {
        return adminRoleDao.deleteAdminRoleMenu(roleId);
    }

    @Override
    public int InsertAdminRoleMenu(int roleId, int menuId) {
        return adminRoleDao.InsertAdminRoleMenu(roleId,menuId);
    }
}
